﻿<Window x:Class="Common.Logging.Loupe.Example.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:sys="clr-namespace:System;assembly=mscorlib"
        xmlns:cl="clr-namespace:Common.Logging;assembly=Common.Logging.Core"
        Title="Common.Logging.Loupe Example App"
        Height="100" WindowStyle="ToolWindow">
    <Window.Resources>
        <ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="LogLevelValues">
                <ObjectDataProvider.MethodParameters>
                    <x:Type TypeName="cl:LogLevel" />
                </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>       
    </Window.Resources>
    
    <Grid Height="Auto" VerticalAlignment="Center">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="100"/>
            <ColumnDefinition Width="150" />
            <ColumnDefinition />
            <ColumnDefinition Width="75"/>
            <ColumnDefinition Width="75"/>
        </Grid.ColumnDefinitions>
        
        <TextBlock VerticalAlignment="Center">Log Level:</TextBlock>
        <ComboBox x:Name="cmbLogLevel" Grid.Column="1"  ItemsSource="{Binding Source={StaticResource LogLevelValues}}" SelectedValue="{Binding Path=CurrentLevel}"/>
        <TextBox x:Name="txtLogMessage" Grid.Column="2">Type message here...</TextBox>
        <Button Grid.Column="3" VerticalAlignment="Bottom" Command="{Binding Path=WriteToLogCommand}" CommandParameter="{Binding ElementName=txtLogMessage, Path=Text}">Log</Button>
        <Button Grid.Column="4" VerticalAlignment="Bottom" Command="{Binding Path=ShowLogCommand}">Show Logs</Button>
    </Grid>
</Window>
